import request from '@/utils/request';

// 返回码配置管理列表查询
export function getList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/outside/code/management/details/list',
		method: 'post',
		data: data,
	});
}

// 根据ID查询返回码配置管理数据
export function getById(id: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/outside/code/management/details/getCodeDetails/' + id,
		method: 'get',
	});
}

// 返回码删除
export function deleteData(ids: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/returnCode/delete/' + ids,
		method: 'delete',
	});
}

// 保存返回码管理信息
export function save(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/outside/code/management/details/save',
		method: 'post',
		data: data,
	});
}
// 获取下载模板
export function getTemplate(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/outside/code/management/details/downloadTemplate',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}

// 上传
export function upload(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/management/outside/code/management/details/upload',
		method: 'post',
		data: data,
	});
}
